<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class BoxResource extends JsonResource
{
    public function toArray($request)
    {
    	$resource = $this->resource;

        $data = [
        	
        	'id' => $resource->id,
	        'name' => $resource->name,
	        'price' => $resource->price,
	        'image' => img_path($resource->image),
	        'max_product_price' => $resource->maxProductPrice(),
	        'min_product_price' => $resource->minProductPrice(),
	        
        ];
        
        return $data;
    }
}
